package com.xunlai.infra.permission.business.converter;

import com.xunlai.infra.permission.business.dao.entity.Area;
import com.xunlai.infra.permission.business.dao.entity.ScenicArea;
import com.xunlai.infra.permission.business.vo.scenic.AreaListVo;
import com.xunlai.infra.permission.business.vo.scenic.ProvinceListVo;
import com.xunlai.infra.permission.business.vo.scenic.ScenicAreaCreateVo;
import com.xunlai.infra.permission.business.vo.scenic.ScenicAreaListVo;
import com.xunlai.infra.permission.business.vo.scenic.ScenicAreaQueryVo;
import javax.annotation.processing.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2024-02-21T19:24:58+0800",
    comments = "version: 1.5.3.Final, compiler: javac, environment: Java 17.0.5 (Amazon.com Inc.)"
)
public class ScenicAreaConverterImpl implements ScenicAreaConverter {

    @Override
    public ScenicArea convertCreateVo2Entity(ScenicAreaCreateVo scenicAreaCreateVo) {
        if ( scenicAreaCreateVo == null ) {
            return null;
        }

        ScenicArea.ScenicAreaBuilder scenicArea = ScenicArea.builder();

        scenicArea.scenicName( scenicAreaCreateVo.getScenicName() );
        scenicArea.scenicProvince( scenicAreaCreateVo.getScenicProvince() );
        scenicArea.scenicCity( scenicAreaCreateVo.getScenicCity() );
        scenicArea.custom( scenicAreaCreateVo.getCustom() );

        return scenicArea.build();
    }

    @Override
    public ScenicAreaListVo convertEntity2ListVo(ScenicArea scenicArea) {
        if ( scenicArea == null ) {
            return null;
        }

        ScenicAreaListVo.ScenicAreaListVoBuilder scenicAreaListVo = ScenicAreaListVo.builder();

        scenicAreaListVo.id( scenicArea.getId() );
        scenicAreaListVo.scenicName( scenicArea.getScenicName() );
        scenicAreaListVo.scenicProvince( scenicArea.getScenicProvince() );
        scenicAreaListVo.scenicCity( scenicArea.getScenicCity() );
        scenicAreaListVo.createUser( scenicArea.getCreateUser() );
        scenicAreaListVo.createTime( scenicArea.getCreateTime() );

        return scenicAreaListVo.build();
    }

    @Override
    public ScenicArea convertQueryVo2Entity(ScenicAreaQueryVo scenicAreaQueryVo) {
        if ( scenicAreaQueryVo == null ) {
            return null;
        }

        ScenicArea.ScenicAreaBuilder scenicArea = ScenicArea.builder();

        scenicArea.scenicName( scenicAreaQueryVo.getScenicName() );
        scenicArea.scenicProvince( scenicAreaQueryVo.getScenicProvince() );
        scenicArea.scenicCity( scenicAreaQueryVo.getScenicCity() );

        return scenicArea.build();
    }

    @Override
    public ProvinceListVo convertAreaEntity2ProvinceListVo(Area area) {
        if ( area == null ) {
            return null;
        }

        ProvinceListVo.ProvinceListVoBuilder provinceListVo = ProvinceListVo.builder();

        provinceListVo.id( area.getId() );
        provinceListVo.name( area.getName() );

        return provinceListVo.build();
    }

    @Override
    public AreaListVo convertAreaEntity2ListVo(Area area) {
        if ( area == null ) {
            return null;
        }

        AreaListVo.AreaListVoBuilder areaListVo = AreaListVo.builder();

        areaListVo.id( area.getId() );
        areaListVo.name( area.getName() );
        areaListVo.pid( area.getPid() );

        return areaListVo.build();
    }
}
